home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
Jogos de Azar
/
fruit.swf
/
scripts
/
C_CoinsMenuCLASS.as
< prev
next >
Wrap
Text File
|
2006-01-17
|
2KB
|
76 lines
_global.C_CoinsMenuCLASS = function()
{
this.init();
};
C_CoinsMenuCLASS.prototype = new MovieClip();
C_CoinsMenuCLASS.prototype.onLoad = function()
{
this.coins = [0.25,1,5];
this.buttons = [this.c_0_25_btn,this.c_1_btn,this.c_5_btn];
this.coins_mc_array = [this.c_0_25_mc,this.c_1_mc,this.c_5_mc];
this.coins_names_array = ["25c","$1","$5"];
var c;
var i = 0;
while(i < this.coins.length)
{
c = this.buttons[i];
c.coin = this.coins[i];
c.addAlt("Use " + this.coins_names_array[i] + " coin\rfor betting");
c.onPress = function()
{
this.hideAlt();
this._parent.setCoin(this.coin);
};
c.useHandCursor = false;
i++;
}
this.setCoin(this.curCoin);
};
C_CoinsMenuCLASS.prototype.lock = function()
{
this.onRelease = function()
{
};
this.useHandCursor = false;
};
C_CoinsMenuCLASS.prototype.unlock = function()
{
delete this.onRelease;
delete this.useHandCursor;
};
C_CoinsMenuCLASS.prototype.setCoin = function(coin)
{
if(!coin)
{
return undefined;
}
var a = this.coins_mc_array;
var i = 0;
while(i < this.buttons.length)
{
if(this.coins[i] == coin)
{
a[i]._brightness = 0;
a[i]._xscale = a[i]._yscale = 120;
this.arow_mc._x = a[i]._x;
this.buttons[i].enabled = false;
}
else
{
a[i]._brightness = -40;
a[i]._xscale = a[i]._yscale = 100;
this.buttons[i].enabled = true;
}
i++;
}
this.curCoin = coin;
var c = this.client;
c.client[c.handler](this.curCoin);
};
C_CoinsMenuCLASS.prototype.setChangeHandler = function(handler, client)
{
this.client = {handler:handler,client:client};
};
ASSetPropFlags(_global,"C_CoinsMenuCLASS",131);
Object.registerClass("C_CoinsMenuCLASS",C_CoinsMenuCLASS);